Methods and apparatus for sorting data

ABSTRACT

A computer implemented system for genomic data sorting, comprising alignment and position mapping. The system maps each read to a position on the reference genome with which the read is associated, followed by sorting these reads by their mapped positions.

CROSS-REFERENCE

This application is a Continuation Application of U.S. application Ser. No. 14/571,120, filed Dec. 15, 2014, which claims the benefit of U.S. Provisional Patent Application No. 61/916,687, filed Dec. 16, 2013, each of which is incorporated herein by reference in its entirety for all purposes.

TECHNICAL FIELD

The present disclosure generally relates to sorting data. The disclosure relates more specifically to improving efficiency of sorting data where the sort function is non-injective with a linearly ordered, finite codomain.

BACKGROUND

The approaches described in this section could be pursued, but are not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.

Current state-of-the-art genome sequencing machines do not, as one might expect, produce one continuous output sequence of the entire genome. Rather, they generate large numbers of relatively short fragments of sequence called reads, which range from dozens to thousands of base pairs in length. Because these reads are output by the machine in no particular order, the first step in analyzing the data in prior approaches is typically to map each read to a position on the reference genome with which the read is associated. This is called alignment. The second step in prior approaches is typically to sort these reads by their mapped positions. Genome sequencing produces large quantities of data that can take hours or days to align and sort, so prior approaches can be improved by eliminating or making more efficient the steps in this analysis.

SUMMARY

The appended claims may serve as a summary of the disclosure.

INCORPORATION BY REFERENCE

All publications, patents, and patent applications mentioned in this specification are herein incorporated by reference to the same extent as if each individual publication, patent, or patent application was specifically and individually indicated to be incorporated by reference.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features of the invention are set forth with particularity in the appended claims. A better understanding of the features and advantages of the present invention will be obtained by reference to the following detailed description that sets forth illustrative embodiments, in which the principles of the invention are utilized, and the accompanying drawings of which:

FIG. 1A illustrates a block diagram providing a high-level view of an example data processing system that may be used in an approach for sorting data.

FIG. 1B illustrates a flow diagram where one example method of processing implements the example system of FIG. 1A.

FIG. 2 illustrates a block diagram where a computer system implements an example sorting algorithm described herein.

FIG. 3 illustrates an example computing architecture for implementing the subject matter described herein.

DETAILED DESCRIPTION OF THE INVENTION

While preferred embodiments of the present invention have been shown and described herein, it will be obvious to those skilled in the art that such embodiments are provided by way of example only. Numerous variations, changes, and substitutions will now occur to those skilled in the art without departing from the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in practicing the invention. It is intended that the following claims define the scope of the invention and that methods and structures within the scope of these claims and their equivalents be covered thereby.

The foregoing needs, and other needs and objectives that will become apparent from the following description, are achieved in the present invention, which comprises in one embodiment a method and apparatus for sorting data. Based on the foregoing, there is a clear need for improved ways to sort data.

The present approach improves sorting efficiency by eliminating the sorting step and producing a sorted result directly from the alignment step.

While the present disclosure is motivated by the problem of genome sequence data analysis, it can be applied to any problem with the same general characteristics. The genome sequencing problem can be generalized as follows:

Consider the human genome which comprises roughly 3 billion base pairs. If L is the actual length, then the genome can be represented as a string H of length L over a finite alphabet {A,C,T,G}. Reads can then be generalized as the set of all strings over the same alphabet with any length from 1 to L inclusive. The process of mapping a read to a position on the genome is therefore a function whose domain is all possible read strings and whose codomain is positions on the reference genome, which is the linearly ordered, finite set {1 . . . L}. As reads of different lengths can be mapped to the same position, this function is non-injective. The present disclosure is therefore applicable to any problem that is equivalent to sorting elements from a finite set where the ordering function is non-injective to a codomain that is a linearly ordered, finite set.

Structural Overview of Data Sorting System

FIG. 1A is a block diagram providing a high-level view of an example data processing system that may be used in an approach for sorting data. In one embodiment, there is initially a set of strings 100 of various lengths ranging from 1 to L, over a given finite alphabet. In various embodiments, strings 100 may be stored in computer storage devices of different types such as volatile main memory, non-volatile storage such as disk or FLASH memory, or other digital electronic storage. There can also be a processing element called the mapper 200, which may be implemented in various embodiments using digital logic in a special-purpose computer, or using one or more computer programs or other software elements that are executed using a general-purpose computer. The mapper 200 can be configured, given the set of strings 100 as input, to apply a non-injective mapping function 201 to each input string and to output each string paired with a position value, which can be a member of the codomain of the mapping function 201.

The embodiment can also include a set of data storage containers 300. The number of storage containers 300 may be equal to L, the number of elements in the codomain of the mapping function. Each of the storage containers 300 is addressable by one of the elements in the codomain. In the example of genome sequencing, there would be roughly 3 billion storage containers 300, one for each base pair, and each of the storage containers is addressable by the position in the genome that it represents.

Optionally one or more compact containers 400 may be provided. The function of compact containers 400 is further described in other sections.

The mapper 200 may be configured to both address any individual one of the storage containers 300 and to add a new data element to that container in O(1) time, constant in the number of containers n. One suitable implementation is an in-memory array of linked lists where each of the storage containers 300 is a linked list and the array is indexed by genome position. Another suitable implementation is a set of on-disk files whose filenames are genome positions and which can each have data appended to it in constant time.

FIG. 1B is a flow diagram that illustrates one method of processing using the example system of FIG. 1A. In an embodiment, the process of FIG. 1B may be implemented using mapper 200.

In step 800, the mapper 200 can read a particular one of the strings in the set 100.

In step 801, the mapper can apply the mapping function 201 to the particular string, which yields a position value for that string.

In step 802, the mapper can address the data container associated with the position value that was determined at step 801.

In step 803, the mapper cam append the particular string and its position value to the data container that was addressed at step 802. Step 803 may include forming a data item that includes the particular string and its position value prior to performing the appending. Data containers may contain more than one data item when multiple strings map to the same position value.

The mapper 200 can then loop back to step 800 until all strings in the set 100 have been processed. For some applications, the output as stored in the data containers 300 at this point can be sufficient as a final result. The data are already sorted and can be accessed in a linear ordered fashion by simply traversing the containers in order. No separate sorting step is required.

Compact Output

If the strings in set 100 are non-unique or there are fewer than L strings, then some of the data containers 300 may not contain any data items. In this situation, the final output can be made more compact, for example, by adding the following steps:

In step 900, the mapper 200 creates a new compact data container 400.

In step 901, the mapper addresses the first of the original data containers 300.

In step 902, the mapper copies any data items found in the first container addressed at step 901, and appends the data items to the new data container 400.

The mapper then loops back to step 901 and addresses the next one of the original data containers 300, and repeats this process until all of the original data containers have been copied and appended to the new compact data container 400.

This operation is O(n) linear in the number of strings in 100.

Non-Deterministic Mapping Function

In some applications the mapping function can map a string to multiple values in the codomain, each with a probability or score associated with it. Such a non-deterministic mapping function can be accommodated by altering step 803 to append the string, the position value, and the probability or score, to each of the data containers to which the mapping function maps the string. All other aspects of the processing can remain the same and the advantages of the present approach are preserved.

Hardware Overview

According to one embodiment, the techniques described herein can be implemented by one or more special-purpose computing devices. The special-purpose computing devices may be hard-wired to perform the techniques, or may include digital electronic devices such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) that are persistently programmed to perform the techniques, or may include one or more general purpose hardware processors programmed to perform the techniques pursuant to program instructions in firmware, memory, other storage, or a combination. Such special-purpose computing devices may also combine custom hard-wired logic, ASICs, or FPGAs with custom programming to accomplish the techniques. The special-purpose computing devices may be desktop computer systems, portable computer systems, handheld devices, networking devices or any other device that incorporates hard-wired and/or program logic to implement the techniques.

For example, FIG. 2 is a block diagram that illustrates a computer system 200 upon which an embodiment of the invention may be implemented. Computer system 200 can include a bus 202 or other communication mechanism for communicating information, and a hardware processor 204 coupled with bus 202 for processing information. Hardware processor 204 may be, for example, a general purpose microprocessor.

Computer system 200 can also include a main memory 206, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 202 for storing information and instructions to be executed by processor 204. Main memory 206 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 204. Such instructions, when stored in non-transitory storage media accessible to processor 204, can render computer system 200 into a special-purpose machine that is customized to perform the operations specified in the instructions.

Computer system 200 can further include a read only memory (ROM) 208 or other static storage device coupled to bus 202 for storing static information and instructions for processor 204. A storage device 210, such as a magnetic disk or optical disk, can be provided and coupled to bus 202 for storing information and instructions.

Computer system 200 may be coupled via bus 202 to a display 212, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 214, including alphanumeric and other keys, can be coupled to bus 202 for communicating information and command selections to processor 204. Another type of user input device is cursor control 216, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 204 and for controlling cursor movement on display 212. This input device typically can have two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that can allow the device to specify positions in a plane.

Computer system 200 may implement the techniques described herein using customized hard-wired logic, one or more ASICs or FPGAs, firmware and/or program logic which in combination with the computer system causes or programs computer system 200 to be a special-purpose machine. According to one embodiment, the techniques herein can be performed by computer system 200 in response to processor 204 executing one or more sequences of one or more instructions contained in main memory 206. Such instructions may be read into main memory 206 from another storage medium, such as storage device 210. Execution of the sequences of instructions contained in main memory 206 can cause processor 204 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions.

The term “storage media” as used herein refers to any non-transitory media that store data and/or instructions that cause a machine to operation in a specific fashion. Such storage media may comprise non-volatile media and/or volatile media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 210. Volatile media includes dynamic memory, such as main memory 206. Common forms of storage media include, for example, a floppy disk, a flexible disk, hard disk, solid state drive, magnetic tape, or any other magnetic data storage medium, a CD-ROM, any other optical data storage medium, any physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, NVRAM, any other memory chip or cartridge.

Storage media is distinct from but may be used in conjunction with transmission media. Transmission media can participate in transferring information between storage media. For example, transmission media can include coaxial cables, copper wire and fiber optics, including the wires that comprise bus 202. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.

Various forms of media may be involved in carrying one or more sequences of one or more instructions to processor 204 for execution. For example, the instructions may initially be carried on a magnetic disk or solid state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 200 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 202. Bus 202 can carry the data to main memory 206, from which processor 204 can retrieve and execute the instructions. The instructions received by main memory 206 may optionally be stored on storage device 210 either before or after execution by processor 204.

Computer system 200 can also include a communication interface 218 coupled to bus 202. Communication interface 218 can provide a two-way data communication coupling to a network link 220 that is connected to a local network 222. For example, communication interface 218 may be an integrated services digital network (ISDN) card, cable modem, satellite modem, or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 218 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 218 can send and receive electrical, electromagnetic or optical signals that carry digital data streams representing various types of information.

Network link 220 typically can provide data communication through one or more networks to other data devices. For example, network link 220 may provide a connection through local network 222 to a host computer 224 or to data equipment operated by an Internet Service Provider (ISP) 226. ISP 226 in turn can provide data communication services through the world wide packet data communication network now commonly referred to as the “Internet” 228. Local network 222 and Internet 228 can both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 220 and through communication interface 218, which carry the digital data to and from computer system 200, are example forms of transmission media.

Computer system 200 can send messages and receive data, including program code, through the network(s), network link 220 and communication interface 218. In the Internet example, a server 230 might transmit a requested code for an application program through Internet 228, ISP 226, local network 222 and communication interface 218.

The received code may be executed by processor 204 as it is received, and/or stored in storage device 210, or other non-volatile storage for later execution.

Benefits of Certain Embodiments

In an embodiment, a solution as described herein can yield a number of benefits compared to prior solutions:

Prior approaches to aligning and sorting genome sequence reads can require a separate sort step which runs in O(n log n), or perhaps O(n log log n) time at best. The present approach improves efficiency by eliminating an explicit sort step. For some applications, no additional computation or processing is required after alignment. If a more compact output is desired, this can be accomplished with an additional linear O(n) step, which is still faster than a full sort.

Control Systems

The present disclosure provides computer control systems that are programmed to implement methods of the disclosure. FIG. 3 shows an example computer system 1001 that is programmed or otherwise configured to sort data. The computer system 1001 can regulate various aspects of data sorting of the present disclosure, such as, for example, data alignment, mapping, networking.

The computer system 1001 includes a central processing unit (CPU, also “processor” and “computer processor” herein) 1005, which can be a single core or multi core processor, or a plurality of processors for parallel processing. The computer system 1001 also includes memory or memory location 1010 (e.g., random-access memory, read-only memory, flash memory), electronic storage unit 1015 (e.g., hard disk), communication interface 1020 (e.g., network adapter) for communicating with one or more other systems, and peripheral devices 1025, such as cache, other memory, data storage and/or electronic display adapters. The memory 1010, storage unit 1015, interface 1020 and peripheral devices 1025 are in communication with the CPU 1005 through a communication bus (solid lines), such as a motherboard. The storage unit 1015 can be a data storage unit (or data repository) for storing data. The computer system 1001 can be operatively coupled to a computer network (“network”) 1030 with the aid of the communication interface 1020. The network 1030 can be the Internet, an internet and/or extranet, or an intranet and/or extranet that is in communication with the Internet. The network 1030 in some cases is a telecommunication and/or data network. The network 1030 can include one or more computer servers, which can enable distributed computing, such as cloud computing. The network 1030, in some cases with the aid of the computer system 1001, can implement a peer-to-peer network, which may enable devices coupled to the computer system 1001 to behave as a client or a server.

The CPU 1005 can execute a sequence of machine-readable instructions, which can be embodied in a program or software. The instructions may be stored in a memory location, such as the memory 1010. Examples of operations performed by the CPU 1005 can include fetch, decode, execute, and writeback.

The storage unit 1015 can store files, such as drivers, libraries and saved programs. The storage unit 1015 can store user data, e.g., user preferences and user programs. The computer system 1001 in some cases can include one or more additional data storage units that are external to the computer system 1001, such as located on a remote server that is in communication with the computer system 1001 through an intranet or the Internet.

The computer system 1001 can communicate with one or more remote computer systems through the network 1030. For instance, the computer system 1001 can communicate with a remote computer system of a user (e.g., operator). Examples of remote computer systems include personal computers (e.g., portable PC), slate or tablet PC's (e.g., Apple® iPad, Samsung® Galaxy Tab), telephones, Smart phones (e.g., Apple® iPhone, Android-enabled device, Blackberry®), or personal digital assistants. The user can access the computer system 1001 via the network 1030.

Methods as described herein can be implemented by way of machine (e.g., computer processor) executable code stored on an electronic storage location of the computer system 1001, such as, for example, on the memory 1010 or electronic storage unit 1015. The machine executable or machine readable code can be provided in the form of software. During use, the code can be executed by the processor 1005. In some cases, the code can be retrieved from the storage unit 1015 and stored on the memory 1010 for ready access by the processor 1005. In some situations, the electronic storage unit 1015 can be precluded, and machine-executable instructions are stored on memory 1010.

The code can be pre-compiled and configured for use with a machine have a processer adapted to execute the code, or can be compiled during runtime. The code can be supplied in a programming language that can be selected to enable the code to execute in a pre-compiled or as-compiled fashion.

Aspects of the systems and methods provided herein, such as the computer system 1001, can be embodied in programming. Various aspects of the technology may be thought of as “products” or “articles of manufacture” typically in the form of machine (or processor) executable code and/or associated data that is carried on or embodied in a type of machine readable medium. Machine-executable code can be stored on an electronic storage unit, such memory (e.g., read-only memory, random-access memory, flash memory) or a hard disk. “Storage” type media can include any or all of the tangible memory of the computers, processors or the like, or associated modules thereof, such as various semiconductor memories, tape drives, disk drives and the like, which may provide non-transitory storage at any time for the software programming. All or portions of the software may at times be communicated through the Internet or various other telecommunication networks. Such communications, for example, may enable loading of the software from one computer or processor into another, for example, from a management server or host computer into the computer platform of an application server. Thus, another type of media that may bear the software elements includes optical, electrical and electromagnetic waves, such as used across physical interfaces between local devices, through wired and optical landline networks and over various air-links. The physical elements that carry such waves, such as wired or wireless links, optical links or the like, also may be considered as media bearing the software. As used herein, unless restricted to non-transitory, tangible “storage” media, terms such as computer or machine “readable medium” refer to any medium that participates in providing instructions to a processor for execution.

Hence, a machine readable medium, such as computer-executable code, may take many forms, including but not limited to, a tangible storage medium, a carrier wave medium or physical transmission medium. Non-volatile storage media include, for example, optical or magnetic disks, such as any of the storage devices in any computer(s) or the like, such as may be used to implement the databases, etc. shown in the drawings. Volatile storage media include dynamic memory, such as main memory of such a computer platform. Tangible transmission media include coaxial cables; copper wire and fiber optics, including the wires that comprise a bus within a computer system. Carrier-wave transmission media may take the form of electric or electromagnetic signals, or acoustic or light waves such as those generated during radio frequency (RF) and infrared (IR) data communications. Common forms of computer-readable media therefore include for example: a floppy disk, a flexible disk, hard disk, magnetic tape, any other magnetic medium, a CD-ROM, DVD or DVD-ROM, any other optical medium, punch cards paper tape, any other physical storage medium with patterns of holes, a RAM, a ROM, a PROM and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave transporting data or instructions, cables or links transporting such a carrier wave, or any other medium from which a computer may read programming code and/or data. Many of these forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to a processor for execution.

The computer system 1001 can include or be in communication with an electronic display that comprises a user interface (UI) for providing, for example, sorted data can be displayed to a user. Examples of UI's include, without limitation, a graphical user interface (GUI) and web-based user interface.

It should be understood from the foregoing that, while particular implementations have been illustrated and described, various modifications can be made thereto and are contemplated herein. It is also not intended that the invention be limited by the specific examples provided within the specification. While the invention has been described with reference to the aforementioned specification, the descriptions and illustrations of the preferable embodiments herein are not meant to be construed in a limiting sense. Furthermore, it shall be understood that all aspects of the invention are not limited to the specific depictions, configurations or relative proportions set forth herein which depend upon a variety of conditions and variables. Various modifications in form and detail of the embodiments of the invention will be apparent to a person skilled in the art. It is therefore contemplated that the invention shall also cover any such modifications, variations and equivalents 

What is claimed is:
 1. A system for processing a plurality of string data values generated from a nucleic acid sequencing machine upon processing a nucleic acid sample, said system comprising: a database comprising said plurality of string data values generated from said nucleic acid sequencing machine upon processing said nucleic acid sample; and one or more computer processors operatively coupled to said database, wherein said one or more computer processors are individually or collectively programmed to: (i) obtain a string data value from said plurality of string data values; (ii) map said string data value to a data container among a plurality of data containers, wherein each of said plurality of string data values is addressable by genomic position with respect to a genome; (iii) append said string data value to said data container (iv) repeat (i)-(iii) for a remainder of said plurality of string data values; and (v) output a continuous output sequence generated from (i)-(iv) wherein (i)-(iii) are performed without sorting said plurality of string data values.
 2. The system of claim 1, wherein, in (ii), said one or more computer processors are individually or collectively programmed to apply a mapping function to said string data value to obtain a position value associated with said string data value.
 3. The system of claim 2, wherein said one or more computer processors are individually or collectively further programmed to select said data container based upon said position value.
 4. The system of claim 1, wherein said one or more computer processors are individually or collectively further programmed to: (i) apply a non-deterministic mapping function to said string data value to obtain (a) a plurality of position values for at least two data containers from said plurality of data containers, and (b) a plurality of probability values each associated with said string data value and with said at least two data containers; (ii) select said at least two data containers based upon said plurality of position values; and (iii) append a copy of said string data value, a position value of said plurality of position values, and a probability value of said plurality of probability values to each of said at least two data containers.
 5. The system of claim 1, wherein said one or more computer processors are individually or collectively further programmed to (i) generate an output data set by traversing said plurality of data containers in linear order, and (ii) successively output string data value from said plurality of string data values in said plurality of data containers.
 6. The system of claim 1, wherein said one or more computer processors are individually or collectively further programmed to: (i) create a compact data container; (ii) address said data container; (iii) copy said string data value in said data container to said compact data container; (iv) repeat (ii) and (iii) for each of said plurality of string data values in said plurality of data containers to yield a compacted continuous output sequence; and (v) output said compacted continuous output sequence.
 7. The system of claim 1, wherein said one or more computer processors are individually or collectively further programmed to associate a probability value to said string data value mapped to said data container.
 8. The system of claim 1, wherein, in (ii), said one or more computer processors are individually or collectively programmed to apply a non-injective mapping function.
 9. A non-transitory computer-readable medium comprising machine-executable code that, upon execution by a processor, implements a method for data processing, comprising: (a) obtaining a string data value from a plurality of string data values; (b) mapping said string data value to a data container among a plurality of data containers, wherein each of said plurality of string data values is addressable by genomic position with respect to a genome; (c) appending said string data value to said data container (d) repeating (a)-(c) for a remainder of said plurality of string data values; and (e) outputting a continuous output sequence generated from (a)-(d), based on traversing the data containers in (b), wherein (a)-(c) are performed without sorting said plurality of string data values.
 10. The non-transitory computer-readable medium of claim 9, wherein, in (b), said mapping comprises applying a mapping function to said string data value to obtain a position value associated with said string data value.
 11. The non-transitory computer-readable medium of claim 10, further comprising selecting said data container based upon said position value.
 12. The non-transitory computer-readable medium of claim 9, further comprising: (a) applying a non-deterministic mapping function to said string data value to obtain (i) a plurality of position values for at least two data containers from said plurality of data containers, and (ii) a plurality of probability values each associated with said string data value and with said at least two data containers; (b) selecting said at least two data containers based upon said plurality of position values; and (c) appending a copy of said string data value, a position value of said plurality of position values, and a probability value of said plurality of probability values to each of said at least two data containers.
 13. The non-transitory computer-readable medium of claim 9, further comprising (a) generating an output data set by traversing said plurality of data containers in linear order, and (b) successively outputting string data value from said plurality of string data values in said plurality of data containers.
 14. The non-transitory computer-readable medium of claim 9, further comprising: (a) creating a compact data container; (b) addressing said data container; (c) copying said string data value in said data container to said compact data container; (d) repeating (b) and (c) for each of said plurality of string data values in said plurality of data containers to yield a compacted continuous output sequence; and (e) outputting said compacted continuous output sequence.
 15. The non-transitory computer-readable medium of claim 9, further comprising associating a probability value to said string data value mapped to said data container.
 16. The non-transitory computer-readable medium of claim 9, wherein, in (b), said mapping comprises applying a non-injective mapping function. 